﻿#include "MeasureView/MeasureCircleCenterSA.h"
#include "MeasureView/MeasureDataSet.h"

namespace Qly
{
MeasureCircleCenterSA::MeasureCircleCenterSA(MeasureDataSet *parent)
    :MeasureCircleCenter(parent)
{
    m_measureType = CircleCenter_SA;
}

int MeasureCircleCenterSA::adjust(double x, double y, double radius)
{
    m_keyPoints_pix[0] = QPointF(x, y);
    m_keyPoints_pix[1] = QPointF(x + radius, y);

    double ps = m_pParent->m_pixSize_um;
    m_keyPoints_um[0] = m_keyPoints_pix[0] * ps;
    m_keyPoints_um[1] = m_keyPoints_pix[1] * ps;

    compute();
    updateText();
    m_measureState = DS_FINISH;
    return m_measureState;
}
}

